package com.webshop.app.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

@Entity
@DiscriminatorValue(value="cc")
public class CreditCard extends Payment {

	private Date expirationDate;

	private String number;

	private String nameOnCard;

	private String creditOrganization;
	
	@OneToOne(mappedBy= "creditcard", cascade=CascadeType.ALL)
	private Invoice invoice;

	public Date getExpirationDate() {
		return expirationDate;
	}

	public void setExpirationDate(Date date) {
		expirationDate = date;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getNameOnCard() {
		return nameOnCard;
	}

	public void setNameOnCard(String name) {
		nameOnCard = name;
	}

	public String getCreditOrganization() {
		return creditOrganization;
	}

	public void setCreditOrganization(String org) {
		creditOrganization = org;
	}

	
	public Invoice getInvoice() {
		return invoice;
	}

}
